Generating Geofences

ABSTRACT

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for generating geofences. One of the methods includes receiving, at a mobile device, a signal emitted by a merchant device associated with a merchant. If the signal is emitted by a merchant device associated with a merchant and the distance between the mobile device and the merchant device satisfies a threshold, a notification is provided on the mobile device indicating proximity of the merchant associated with the merchant device.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to and is a continuation of U.S. patentapplication Ser. No. 15/040,618, filed on Feb. 10, 2016 (U.S. Pat. No.9,961,491 to be issued on May 1, 2018), which is a divisional of U.S.patent application Ser. No. 14/040,328, filed on Sep. 27, 2013 (U.S.Pat. No. 9,351,114 issued on May 24, 2016), which claims the benefitunder 35 U.S.C. § 119(e) of the filing date of U.S. Provisional PatentApplication No. 61/858,553, filed on Jul. 25, 2013, entitled “GeofencingImprovements to Core Location,” the entirety of which is hereinincorporated by reference.

BACKGROUND

A geofence is a virtual perimeter for a real world geographic area.Generally, a geofence can be measured by a radius around a location. Amobile computing device can generate a geofence around a location, forexample, a merchant location. The mobile device can detect when themobile device enters or exits the geofence. The detection can occur as abackground process on an operating system of the mobile device. Based onthe detection, an application or an operating system of the mobiledevice can generate a notification.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic illustration of an example geofence generationsystem.

FIGS. 2-6 are example maps that illustrate a method of generatinggeofences.

FIG. 7 is a flow chart of a method of generating geofences.

FIG. 8A illustrates geofences generated for a sparse area.

FIG. 8B illustrates generating larger local geofences for a sparse area.

FIG. 9 is a flow chart of an example process for adjusting the size oflocal geofences in a sparse region.

FIG. 10A illustrates geofences generated for a dense area.

FIG. 10B illustrates a coalesced geofence.

FIG. 10C illustrates generating additional local geofences aftergenerating a coalesced geofence.

FIG. 11 is a flow chart of an example process for coalescing geofences.

FIG. 12 illustrates geofencing using wireless beacons.

FIG. 13 is a flow chart of an example process for receiving geolocationnotifications using wireless beacons.

FIG. 14 is a block diagram of an exemplary architecture of a mobiledevice capable of generating geofences.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

FIG. 1 is a schematic illustration of an example geofence generationsystem 100. The system 100 includes a mobile computing device 102, e.g.,a smartphone, a portable media player, or tablet computer. The mobiledevice 102 includes a location detection engine 104, a geofencing engine106, and a notification engine 108.

The mobile device 102 can detect its location using the locationdetection engine 104. The location detection engine 104 can detect themobile device's current location using WiFi hotspots, cellular towersignals, and/or Global Positioning System (GPS) signals. The locationdetection engine 104 can run as a foreground or background process toprovide the mobile device's location. In some implementations, thelocation detection engine 104 can be provided by the operating system ofthe mobile device 102. In some implementations, the location detectionengine accesses a remote server 114 to make a call for locationinformation, e.g., the remote server can receive a list of WiFi hotspotsfrom the mobile device and can provide a location based on the list, orthe remote server can request a location from a cellular service.

The mobile device 102 can generate geofences using the geofencing engine106 or the mobile device 102 can receive geofences from a server, e.g.,remote server 114. In some implementations, the geofences enclose acircular or elliptical region that includes a location, which may be ator near the center of the region. In some implementations, the geofencesenclose polygonal regions that include a location. The geofences canhave perimeters that are established by an operating system or anapplication running on the mobile device 102. For example, a geofencecan be established as enclosing a circular region having a radius, e.g.,of 100 feet. A merchant location may be at or near the center of theregion.

In some implementations, as part of the geofence generation process, themobile device 102 can store WiFi hotspot identifications associated witha geofence. The mobile device 102 sends a request to a WiFi lookupservice 116. The request can include a location around which a geofenceshould be generated and a radius. The location can be established by thelocation detection engine or received from a location database 112. TheWiFi lookup service 116 can respond with a set of WiFi hotspotidentifications based on the location and the radius. In someimplementations, the WiFi lookup service 116 also responds withlongitude and latitude coordinates of the WiFi identifications. Theresponse is stored by the mobile device 102, and the stored WiFi hotspotidentifications are associated with the geofence. Geofences cantherefore be represented not only using latitude and longitudecoordinates, but also using WiFi hotspot identifications.

The geofence engine 106 can detect whether the mobile device 102 isinside or outside of a generated geofence. In some implementations, thedetection is based on the set of WiFi hotspot identifications. Themobile device 102 can identify surrounding WiFi hotspots, e.g., using aWiFi detector, for the mobile device's current location. The mobiledevice 102 can compare the current WiFi hotspot identifications to thestored WiFi hotspot identifications associated with the geofence. If themobile device 102 determines that the current WiFi hotspotidentifications are equivalent to the stored WiFi hotspotidentifications, e.g., using a matching criterion, then the mobiledevice determines that the it is located outside the geofence, On theother hand, if the mobile device determines that the current WiFihotspot are equivalent to the stored WiFi hotspot identifications, e.g.,using a matching criterion, then the mobile device determines that it islocated inside the geofence.

Alternatively, the detection is based on a current location of themobile device as determined by GPS signals or cellular towertriangulation. For example, the geofence engine 106 can use GPS signalsor cellular tower triangulation to obtain longitude and latitudecoordinates of the mobile device's current location. The geofence engine106 can compare the longitude and latitude coordinates to determinewhether the mobile device is within the geofence.

Upon detection that the mobile device is inside a geofence, the geofenceengine 106 sends an indication to the notification engine 108. Thenotification engine 108 can provide a notification to an operatingsystem or application running on the mobile device 102. For example, thenotification can cause an application to execute an action, e.g., send athird-party request to an external server. In some implementations, thenotification is sent to an application associated with a merchant toindicate to a user that the user is proximate to the geographic locationof the merchant. For example, the application can rank by distance tothe mobile device a number of merchants that are nearby, as determinedby associated geofences and display, on the mobile device, the rankingof the nearby merchants. The application can also send the notificationto a computer system associated with the merchant, e.g., to send informthe merchant computer system about the proximity of the mobile device tothe merchant.

The mobile device 102 can communicate with a location database 112 overa network (e.g., the Internet 110). The location database 112 provideslocations that are associated with points of interest (e.g., merchantdevices). For example, the location database 112 can receive a requestincluding a mobile device's location. The location database 112 can thenrespond with one or more merchant locations near the mobile device'slocation. In some implementations, the locations are represented aslongitudes and latitudes. The mobile device 102 can provide the merchantlocations to the geofencing engine 106. The geofencing engine 106 canprocess the merchant locations and generate a geofence around thelocations.

FIGS. 2-6 are example maps that illustrate a method of generatinggeofences.

FIG. 2 is an example map 200 that illustrates a mobile device 202identifying locations 204, 206, 208, 210. The mobile device 202 receivesnearby locations (e.g., by communicating with a location database asdescribed above in reference to FIG. 1). In some implementations, thelocations are locations of merchants. In some implementations, themobile device 202 is limited to detecting a maximum number of concurrentgeofences. For example, the maximum number can be 2, 4, 10, 20, 50, ormore geofences. The mobile device 202 can identify the locations thatare closest to the mobile device's current location, with a conventionalEuclidean distance calculation. In some implementations, the mobiledevice identifies a number of nearby locations that is equivalent to themaximum number of concurrent geofences. That is, if N is the maximumnumber of concurrent geofences, then N closest locations are identified.For example, if the maximum number of concurrent geofences is 4geofences, the mobile device 202 identifies the 4 closest merchantdevices.

FIG. 3 is an example map 300 that illustrates the mobile device 202generating “small” geofences, also referred to as local geofences,around the locations 204, 206, 208. The mobile device 202 generates thegeofences around the locations nearest to the mobile device's location.In some implementations, the number of generated geofences is fewer thanthe maximum number of concurrent geofences. In some otherimplementations, if the mobile device 202 is limited to generating amaximum number of concurrent geofences, the mobile device 202 generatesgeofences numbering one less than the maximum number of concurrentgeofences. That is, if N is the maximum number of concurrent geofences,then geofences are generated for the N−1 closest locations. For example,as illustrated in FIG. 3, if the limit is 4 geofences, the mobile device202 generates 3 geofences 214, 216, 218 around the 3 nearest locations204, 206, 208. The mobile device 202 does not generate a geofence aroundthe fourth closest merchant device location (e.g., merchant device 210).The fourth closest location can be an outer bound location that isfarther, from the mobile device's location, than the other merchantdevice locations that have small geofences. These geofences can haveperimeters suitable for determination that the mobile device is presentat or close to the location, e.g., that the mobile device is at abuilding or an establishment corresponding to the location. For example,the N−1 geofences can have relatively small perimeters, e.g., a radiusof 100, 150, or 500 feet. The mobile device 202 can use the remaininggeofence for a large geofence as described below in reference to FIG. 4.

FIG. 4 is an example map 400 that illustrates a mobile device 202generating a “large” geofence, also referred to as a triggeringgeofence, surrounding the mobile device 202. With a remaining geofence(e.g., the remaining geofence as described above in reference to FIG.3), the mobile device 202 generates the geofence around the mobiledevice's current location and sets a relatively large radius for thegeofence, relative to the size of the geofences used to detect presencenear the locations 204, 206, 208. The large radius encloses up to, butdoes not include, the closest location that does not have a smallgeofence. That is, if N is the maximum number of concurrent geofences,then the perimeter of the “large” geofences is set to include the N−1closest locations, but not include the Nth closest location. Forexample, as illustrated in FIG. 4, the mobile device 202 generated smallgeofences around locations 204, 206, and 208, but did not generate ageofence around location 210. The “large” geofence is established toinclude locations 204, 206, and 208 but does not include location 210.In some implementations, the radius of the large geofence is thedistance between the mobile device's current location and a point on anouter bound circumference. The outer bound circumference can be aperimeter of the geofence that would be generated around the closestlocation that does not have a small geofence (e.g., location 210).

FIG. 5 is an example map 500 that illustrates a mobile device 202exiting the large geofence. As described above in reference to FIG. 1,the mobile device 202 can detect when it exits a geofence. If thegeofencing engine of the mobile device 202 detects that the mobiledevice 202 is located outside of the large geofence, the mobile device202 repeats the process for generating geofences, as described above inreference to FIGS. 2-4.

FIG. 6 is an example map 600 that illustrates a mobile device 202repeating the process of generating geofences. The mobile device 202performs, again, the processes described above in reference to FIGS. 2and 4. For example, the mobile device 202 identifies merchants near themobile device's location, generates small geofences around themerchants' locations, e.g., merchant device 210, and generates a largegeofence around the mobile device's location. In some implementations,the mobile device 202 receives more nearby merchants from a locationdatabase. In alternative implementations, the mobile device 202previously cached numerous nearby locations and identifies nearbymerchants from the cache. In this way, the mobile device 202 can accessan “infinite” number of geofences around merchant locations.

Although the description above focuses on geofences around locations ofmerchant devices, geofences can be generated around a location of anycomputer device, e.g., a user's smartphone or a laptop. In someimplementations, geofences are generated around raw coordinates, e.g.,coordinates received from a server.

FIG. 7 is a flow chart of an example process 700 for generatinggeofences by a mobile device. The mobile device stores a set oflocations as described above in reference to FIG. 1 (step 702). Themobile device obtains a current location of the mobile device (step704). The mobile device identifies locations that are nearest to thecurrent location as described above in reference to FIG. 2 (step 706).The locations can be obtained from the set of stored locations in themobile device. The mobile device identifies an outermost location anddetermines an outer bound location (step 708). The outer bound locationis located farther from the current location than any of the nearestlocations other than the outermost location. The mobile device generatesa local geofence around each nearest location (step 710) and generates atriggering geofence around the current location (step 712), which aredescribed above in reference to FIGS. 3 and 4. Upon detecting that themobile device has exited the triggering geofence, the mobile device theniterates steps 704-712 for a new current location around the mobiledevice, as described above in reference to FIGS. 5 and 6.

FIG. 8A illustrates geofences generated for a sparse area. In sparseareas, where merchants or other points of interest are widelydistributed and have a low density, the triggering geofence may be quitelarge, e.g., 3000 feet. The location granularity for the location of themobile device may degrade in sparse regions because of geolocationresolution limitations of certain geolocation technologies, e.g., GPSsignals and cellular triangulation.

Mobile device 802 is near three merchant locations, the merchantlocations 804, 806, and 808. Each of the merchant locations 804, 806,and 808, has a local geofence, e.g., the geofences 832, 834, and 836,each enclosing a circular region having an initial radius r_(i) 842.Although only three locations are shown, the process is equallyapplicable to an arbitrary number of merchant locations.

The mobile device 802 generates a triggering geofence 816 that enclosesa circular geographic region 820 having a radius R 844 and that includesthe three merchant locations 804, 806, and 808, which may be based onthe location of the merchant device 810. The geolocation resolution forthe location of the mobile device may be poor if the triggering geofence816 is large. In other words, the location of the mobile device 802 maynot be determined as precisely as is possible for other areas due to thesize of the triggering geofence 816. For example, although the mobiledevice 802 has determined its own location to be outside of the localgeofence 836 for the merchant device 808, the mobile device 802 mayactually be located within the local geofence 836. The inaccuracy ingeolocation thus may prevent an appropriate notification on the mobiledevice. Thus, when the triggering geofence 816 is large, the mobiledevice can switch over to using a larger size for the local geofences.

FIG. 8B illustrates generating larger local geofences for a sparse area.In some implementations, the mobile device 802 computes a modifiedradius r_(m) 846 for local geofences that is a ratio α of the radius R844 of the triggering geofence. The modified radius r_(m) 846 increasesthe size of the local geofences, increasing the likelihood that themobile device 802 will correctly generate a notification when inside alocal geofence when located near a corresponding merchant location. FIG.9 is a flow chart of an example process for adjusting the size of localgeofences in a sparse region. In general, a mobile device increases asize of local geofences when a size of a triggering geofence satisfies asize threshold. The example process can be implemented by one or morecomputer programs installed on one or more computers. The process willbe described as being performed by a mobile device, e.g. the mobiledevice 802 of FIGS. 8A and 8B. The mobile device obtains locationinformation for nearby merchants (902). For example, the mobile devicecan provide its own location to a server and can obtain a list of allmerchants that are within a threshold distance to the location of themobile device, e.g. all merchants located within five miles.

The mobile device generates local geofences of a first size for each ofa number of the nearby merchants (904). The mobile device may generatelocal geofences only for a limited number of nearest merchant locationsof the list of merchant locations received from the server.

The mobile device can then determine the parameters for a triggeringgeofence that will enclose a region that includes the number of nearestmerchant locations. For example, the mobile device can define thetriggering geofence as a circular region centered on the mobile deviceand having a particular radius. In some implementations, the radius isthe distance between the mobile device and an outer merchant locationthat is not among the number of nearest merchant locations, e.g., thenext-nearest merchant location, or, equivalently, the N+1th nearestmerchant location for N nearest merchant locations. The triggeringgeofence can also be an elliptical or a polygonal region.

The mobile device determines that a size of the triggering geofencesatisfies a threshold (906). The mobile device can use any appropriatesize metric for making a determination about the size of the triggeringgeofence. For example, if the triggering geofence is a circular region,the mobile device can determine that the radius of the circular regionsatisfies a threshold. If the triggering geofence is an ellipticalregion, the mobile device can determine that an axis of the ellipsesatisfies a threshold. The mobile device can also compute an area of theregion enclosed by the triggering geofence to determine that a size ofthe triggering geofence satisfies a threshold.

The mobile device determines a second size for local geofences that islarger than the first size (908). If the triggering geofence is large,the mobile device can increase the size of the local geofences bymodifying an appropriate size metric of the local geofences. Forexample, the mobile device can increase a radius, axis, or area of localgeofences.

In some implementations, the mobile device determines an updated radiusvalue that is based on a ratio of the radius of the triggering geofence.For example, the mobile device can compute a modified radius r_(m) basedon a radius R of the trigging geofence and a ratio α according to:

r _(m) =α×R.

The mobile device generates updated local geofences of the second sizefor each of the nearby merchants (910). For example, the mobile devicemay determine that the mobile device is located in an updated localgeofence for a particular merchant location and generate an appropriatenotification. Thus, the updated size for the local geofences candecrease the likelihood that poor geolocation resolution in a particulararea will result in a missed geofence notification.

FIG. 10A illustrates geofences generated for a dense area. In denseareas, where merchants or other points of interest are denselydistributed, the trigging geofence may be quite small, e.g. less than100 feet. When the triggering geofence is small, the triggering geofencemay not enclose a substantial portion of some of the local geofences, orthe small size may result in overly frequent updates on a mobile deviceto the triggering geofence and the local geofences.

Mobile device 1002 is near three merchant locations, e.g., the merchantlocations 1004, 1006, and 1008. Each of the merchant locations 1004,1006, and 1008, has been assigned a local geofence, e.g., the geofences1032, 1034, and 1036.

The mobile device generates a triggering geofence 1040 based on thenext-nearest merchant location 1010. Because the area is denselypopulated, the next-nearest merchant location 1010 is only slightlyfarther away from the other merchant locations, resulting in a smalltriggering geofence 1040 that is not substantially larger than the localgeofences 1032, 1034, and 1036.

FIG. 10B illustrates a coalesced geofence. When the triggering geofenceis small, the mobile device can select two or more of the nearestmerchant locations to share a common coalesced geofence. A coalescedgeofence generates similar notifications as a local geofence, but thenotification is applied to all of the two or merchants that share thecommon coalesced geofence. In some implementations, a coalesced geofenceencloses a region that encompasses all of the regions enclosed by thelocal geofences of merchant locations that share the coalesced geofence.

For example, due to the small size of the triggering geofence 1040, themobile device 1002 generates a coalesced geofence 1050 for the merchantlocations 1004, 1006, and 1008. The coalesced geofence 1050 encloses aregion that includes the regions enclosed by the local geofences 1032,1034, and 1036. Thus, when the mobile device enters the region enclosedby the coalesced geofence 1050, the mobile device will provide anotification for all three merchants at merchant locations 1004, 1006,and 1008.

FIG. 10C illustrates generating additional local geofences aftergenerating a coalesced geofence. Because a coalesced geofence is sharedby multiple merchant locations, generating a coalesced geofence can freeup resource allocation for one or more additional local geofences. Forexample, because the coalesced geofence 1050 is shared by three merchantlocations, the mobile device 1002 can generate two additional localgeofences, e.g., the local geofence 1070 for the merchant location 1010and the local geofence 1080 for the merchant location 1012.

The additional local geofences will generally also increase the size ofthe triggering geofence, e.g., by increasing the distance between themobile device and an outer merchant location that is not among a numberof nearest merchant locations. For example, the mobile device 1002 cangenerate an updated triggering geofence 1060 that encloses a region thatincludes the five merchant locations 1004, 1006, 1008, 1010, and 1012,but that does not include the outer merchant location 1014.

FIG. 11 is a flow chart of an example process for coalescing geofences.In general, in a densely populated region a mobile device willrepeatedly coalesce geofences until the triggering geofence is of asufficiently large size. The example process can be implemented by oneor more computer programs installed on one or more computers. Theprocess will be described as being performed by a mobile device, e.g.the mobile device 1002 of FIGS. 10A-10C.

The mobile device obtains location information for a plurality of nearbymerchants (1102). As described above, the mobile device can provide itsown location to a server and receive a plurality of merchant locationsthat are within a particular distance to the location of the mobiledevice.

The mobile device determines a number of nearest merchant locations forlocal geofences (1104). For example, the mobile device may haveallocated only a particular number of merchant locations for generatinggeofences, e.g. only 10, 20, or 50 local geofences.

The mobile device determines a triggering geofence that encloses aregion including the number of nearest merchant locations (1106). Forexample, as described above with reference to FIG. 9, the mobile devicecan determine an appropriate triggering geofence, which may be based onan outer merchant location that is not among the number of nearestmerchant locations.

The mobile device determines whether the size of the region enclosed bythe triggering geofence is large enough (1108). For example, asdescribed above with reference to FIG. 9, the mobile device can computean appropriate measure of size for the triggering geofence and determinewhether the size measure satisfies a threshold.

In some implementations, the mobile device compares the size of thetriggering geofence to the size of the local geofences. The mobiledevice can compute a ratio between the size of the triggering geofenceand the size of the local geofences and determine whether the ratiosatisfies a threshold. For example, the mobile device can require thatthe triggering geofence have a radius that is at least five times theradius of the local geofences.

The mobile device can also determine whether a region enclosed by thetrigging geofence is large enough based on a number of merchantlocations that the region includes. In some implementations, the mobiledevice determines that the region enclosed by the triggering geofence isnot large enough if the region includes more than a threshold number ofmerchant locations, e.g. more than 50 merchant locations.

If the size of the region enclosed by the triggering geofence is largeenough, the process ends (branch to 1110).

If the size of the region enclosed by the triggering geofence is notlarge enough, the mobile device selects two or more nearest merchantlocations to share a common coalesced geofence (branch to 1112). Themobile device can select two or more of the nearest merchant locationsaccording to one or more criteria. For example, the mobile device canselect the two merchant locations that are nearest to the mobile device.The mobile device can also select the two merchant locations that arenearest to each other among the number of nearest merchant locations.The mobile device can also compute a measure of overlap between regionsenclosed by local geofences for two locations, e.g. a percentage ofcommon area, and select two locations that have the greatest measure ofoverlap.

The mobile device generates a coalesced geofence for the two or moreselected merchant locations (1114). In general, the mobile device willgenerate a coalesced geofence that encloses a region that includes asmuch of the multiple regions that would have been enclosed by individuallocal geofences.

In some implementations, the mobile device determines a circular regionthat is tangent to all the circular regions of the individual localgeofences and which includes all the circular regions of the individuallocal geofences. The mobile device can determine the center point (x, y)and radius r of a solution circle by using an algebraic solution to theProblem of Apollonius from three circular regions defined by parameters(x1, y1, r1), (x2, y2, r2), and (x3, y3, r3). The solution can beobtained by solving the following simultaneous quadratic equations:

(x−x ₁)+(y−y ₁)−(r±r ₁)²=0

(x−x ₂)²+(y−y ₂)²−(r±r)²=0, and

(x−x ₃)²+(y−y ₃)²−(r±r ₃)²=0.

After generating a region for the coalesced geofence, the mobile deviceassociates each of the selected merchant locations with the coalescedgeofence. Thus, when the mobile device enters the region enclosed by thecoalesced geofence, the mobile device will generate a notification foreach of the two or more merchant locations that share the commoncoalesced geofence.

Because multiple merchant locations are associated with a singlecoalesced geofence, the creation of the coalesced geofence may free upone or more allocated geofences on the mobile device. Thus, the mobiledevice can again select an updated number of nearest merchant locations(1104). The updated number of nearest merchant locations may includeadditional merchant locations that were not previously among the nearestmerchant locations. The mobile device can then generate additional localgeofences for the additional merchant locations. The mobile device canthen repeat the steps of generating a triggering geofence based on theadditional merchant locations (1106) and determining whether the size ofthe triggering geofence is large enough (1108). The mobile device canrepeat these steps until the size of the triggering geofence is largeenough, e.g., is larger than a particular threshold size.

FIG. 12 illustrates geofencing using wireless beacons. In thisspecification, a wireless beacon refers to a personal user device thatcontinuously or repeatedly emits mid-range to short-range radio signalsthat can directly communicate information wirelessly to other devices. Awireless beacon can communicate information, e.g. a user identifier, toanother device without the devices engaging in a pairing process thatrequires user input and without requiring explicit user authorization tocommunicate with another device. The wireless beacon can be part of amobile device, e.g. a mobile phone, or it can be a personal standalonedevice. The radio signals emitted by the wireless beacon can be part ofany appropriate standard for mid-range to short-range radiocommunications having an operable range of at least 1 meter and up toabout 50 meters, e.g. Bluetooth, Bluetooth 4.0, and Bluetooth Low Energy(BLE).

For example, a merchant can install an application on a BLE-enabledmobile phone or tablet. The application can cause the mobile phone ortable to emit BLE signals at regular intervals, e.g., every two seconds.The BLE signal can encode a particular identifier of the merchant, whichcan be used by users nearby to identify the signal as originating from amerchant.

Mobile device 1202 is near three merchant locations, the locations 1204,1206, and 1208. Each of the merchants at the merchant locations has awireless beacon that emits a signal, e.g., the signals 1214, 1216, and1218.

The mobile device 1202 is within signal range of only two of themerchant devices, e.g., the merchant devices 1206 and 1208. The mobiledevice 1202 can determine that is within range of the merchant devicesby using a signal strength of the signal emitted by the merchantdevices.

When the mobile device 1202 is within range of a merchant device, themobile device generates a notification, e.g., to notify a user of themobile device that the merchant associated with the merchant device isproximate to the user. The mobile device can then use the wirelesssignal emitted by the merchant device associated with the merchant toobtain information for the merchant, e.g. a merchant name, a merchantaddress or other contact information, or a geographic location of themerchant, to name a few examples.

FIG. 13 is a flow chart of an example process for receiving geolocationnotifications using wireless beacons. In general, a mobile devicereceives a signal emitted by a merchant device and determines that it iswithin range of the merchant device. The mobile device can then obtainmore information for the merchant from the signal emitted by themerchant or from other channels, e.g., the Internet. The mobile devicecan then provide a notification to signal proximity of the mobile deviceto the merchant location. The example process can be implemented by oneor more computer programs installed on one or more computers. Theprocess will be described as being performed by a mobile device, e.g.the mobile device 1202 of FIG. 12.

The mobile device receives a signal emitted by a merchant device (1302).From the mobile device's perspective, the receipt of a signal by itselfis generally insufficient to determine that the signal is received froma merchant and not from another device emitting wireless signals.

The mobile device determines that the signal is emitted by a merchantdevice associated with a merchant (1304). To distinguish merchants fromother devices and wireless beacons in the area that may also be emittingsignals, the merchant device can encode an identifier in the signal. Themobile device can then determine that the signal is being emitted by amerchant device associated with a merchant by examining the identifierencoded in the signal.

In some implementations, the identifier is a reserved merchantidentifier issued by a central authority, e.g., a payment service systemwith which the merchant has an account.

In some other implementations, the identifier is unique to the merchantand the mobile device can use the identifier to obtain more informationin order to verify that the signal is being emitted by a merchantdevice. For example, the mobile device can provide the identifier to alookup system to verify that the identifier is associated with amerchant.

To prevent fraud or impersonation of a merchant's signal, a centralauthority, e.g., a payment service system, can issue rotating reservedor merchant-specific identifiers to the merchants on a periodic basis.When the mobile device receives the identifier, the mobile device cancommunicate with the central authority to verify that the identifier isfrom a merchant device and that the merchant device is authenticated tobe associated with the actual merchant, and not another deviceimpersonating the merchant.

In some implementations, detection of a merchant signal and decoding ofthe identifier at all is an indication that the merchant device isnearby or within a threshold distance from the location of the merchantdevice. Thus, the mobile device may provide a notification any time thata merchant identifier is received and decoded from a signal emitted by amerchant device. However, in some other implementations, the mobiledevice performs an additional distance-based proximity check.

The mobile device determines a distance between the mobile device andthe merchant device (1306). The mobile device can determine the distancein a number of ways. For example, the mobile device can measure thestrength of the signal emitted by the merchant device, e.g., an receivedsignal strength indicator, and convert the measure of signal strengthinto a distance using conventional methods.

The merchant device can also provide, to the mobile device using theemitted signal, a location of the merchant device. The mobile device canthen determine its own location and use the location of the merchantdevice to compute a distance.

The mobile device determines that the distance satisfies a threshold(1308), and the mobile device provides a notification on the mobiledevice indicating proximity of the merchant associated with the merchantdevice (1310).

In some implementations, the distance threshold depends on a density ofnearby merchants. If the density is high, the mobile device may use asmaller distance threshold to prevent notifications from too many nearbymerchants. In contrast, if the density is low, the mobile device may usea larger distance threshold to increase the number of notifications ofnearby merchants.

The notification can include any appropriate information received fromthe emitted signal from the merchant device, e.g. a merchant name, amerchant address or other contact information, a geographic location ofthe merchant, or directions to the merchant from the mobile device'scurrent location, to name a few examples.

FIG. 14 illustrates a block diagram of an exemplary architecture of amobile device capable of generating geofences. Architecture 1400 can beimplemented in any device for generating the features described inreference to FIGS. 1-13, including but not limited to portable ordesktop computers, smart phones and electronic tablets, televisionsystems, game consoles, kiosks and the like. Architecture 1400 caninclude memory interface 1402, data processor(s), image processor(s) orcentral processing unit(s) 1404, and peripherals interface 1406. Memoryinterface 1402, processor(s) 1404 or peripherals interface 1406 can beseparate components or can be integrated in one or more integratedcircuits. The various components can be coupled by one or morecommunication buses or signal lines.

Sensors, devices, and subsystems can be coupled to peripherals interface1406 to facilitate multiple functionalities. For example, motion sensor1410, light sensor 1412, and proximity sensor 1414 can be coupled toperipherals interface 1406 to facilitate orientation, lighting, andproximity functions of the device. For example, in some implementations,light sensor 1412 can be utilized to facilitate adjusting the brightnessof touch surface 1446. In some implementations, motion sensor 1410(e.g., an accelerometer, gyros) can be utilized to detect movement andorientation of the device. Accordingly, display objects or media can bepresented according to a detected orientation (e.g., portrait orlandscape).

Other sensors can also be connected to peripherals interface 1406, suchas a temperature sensor, a biometric sensor, or other sensing device, tofacilitate related functionalities.

Location processor 1415 (e.g., GPS receiver) can be connected toperipherals interface 1406 to provide geo-positioning. Electronicmagnetometer 1416 (e.g., an integrated circuit chip) can also beconnected to peripherals interface 1406 to provide data that can be usedto determine the direction of magnetic North. Thus, electronicmagnetometer 1416 can be used as an electronic compass.

Camera subsystem 1420 and an optical sensor 1422, e.g., a chargedcoupled device (CCD) or a complementary metal-oxide semiconductor (CMOS)optical sensor, can be utilized to facilitate camera functions, such asrecording photographs and video clips.

Communication functions can be facilitated through one or morecommunication subsystems 1424. Communication subsystem(s) 1424 caninclude one or more wireless communication subsystems. Wirelesscommunication subsystems 1424 can include radio frequency receivers andtransmitters and/or optical (e.g., infrared) receivers and transmitters.Wired communication system can include a port device, e.g., a UniversalSerial Bus (USB) port or some other wired port connection that can beused to establish a wired connection to other computing devices, such asother communication devices, network access devices, a personalcomputer, a printer, a display screen, or other processing devicescapable of receiving or transmitting data. The specific design andimplementation of the communication subsystem 1424 can depend on thecommunication network(s) or medium(s) over which the device is intendedto operate. For example, a device may include wireless communicationsubsystems designed to operate over a global system for mobilecommunications (GSM) network, a GPRS network, an enhanced data GSMenvironment (EDGE) network, 802.x communication networks (e.g., WiFi,WiMax, or 3G networks), code division multiple access (CDMA) networks,and a Bluetooth™ network. Communication subsystems 1424 may includehosting protocols such that the device may be configured as a basestation for other wireless devices. As another example, thecommunication subsystems can allow the device to synchronize with a hostdevice using one or more protocols, such as, for example, the TCP/IPprotocol, HTTP protocol, UDP protocol, and any other known protocol.

Audio subsystem 1426 can be coupled to a speaker 1428 and one or moremicrophones 1430 to facilitate voice-enabled functions, such as voicerecognition, voice replication, digital recording, and telephonyfunctions.

I/O subsystem 1440 can include touch controller 1442 and/or other inputcontroller(s) 1444. Touch controller 1442 can be coupled to a touchsurface 1446. Touch surface 1446 and touch controller 1442 can, forexample, detect contact and movement or break thereof using any of anumber of touch sensitivity technologies, including but not limited tocapacitive, resistive, infrared, and surface acoustic wave technologies,as well as other proximity sensor arrays or other elements fordetermining one or more points of contact with touch surface 1446. Inone implementation, touch surface 1446 can display virtual or softbuttons and a virtual keyboard, which can be used as an input/outputdevice by the user.

Other input controller(s) 1444 can be coupled to other input/controldevices 1448, such as one or more buttons, rocker switches, thumb-wheel,infrared port, USB port, and/or a pointer device such as a stylus. Theone or more buttons (not shown) can include an up/down button for volumecontrol of speaker 1428 and/or microphone 1430.

In some implementations, device 1400 can present recorded audio and/orvideo files, such as MP3, AAC, and MPEG files. In some implementations,device 1400 can include the functionality of an MP3 player and mayinclude a pin connector for tethering to other devices. Otherinput/output and control devices can be used.

Memory interface 1402 can be coupled to memory 1450. Memory 1450 caninclude high-speed random access memory or non-volatile memory, such asone or more magnetic disk storage devices, one or more optical storagedevices, or flash memory (e.g., NAND, NOR). Memory 1450 can storeoperating system 1452, such as Darwin, RTXC, LINUX, UNIX, OS X, WINDOWS,or an embedded operating system such as VxWorks. Operating system 1452may include instructions for handling basic system services and forperforming hardware dependent tasks. In some implementations, operatingsystem 1452 can include a kernel (e.g., UNIX kernel).

Memory 1450 may also store communication instructions 1454 to facilitatecommunicating with one or more additional devices, one or more computersor servers. Communication instructions 1454 can also be used to selectan operational mode or communication medium for use by the device, basedon a geographic location (obtained by the GPS/Navigation instructions1468) of the device. Memory 1450 may include graphical user interfaceinstructions 1456 to facilitate graphic user interface processing;sensor processing instructions 1458 to facilitate sensor-relatedprocessing and functions; phone instructions 1460 to facilitatephone-related processes and functions; electronic messaging instructions1462 to facilitate electronic-messaging related processes and functions;web browsing instructions 1464 to facilitate web browsing-relatedprocesses and functions and display GUIs; media processing instructions1466 to facilitate media processing-related processes and functions;GPS/Navigation instructions 1468 to facilitate GPS andnavigation-related processes; camera instructions 1470 to facilitatecamera-related processes and functions; and instructions 1472 forgenerating geofences. The memory 1450 may also store other softwareinstructions for facilitating other processes, features andapplications, such as applications related to navigation, socialnetworking, location-based services or map displays.

Each of the above identified instructions and applications cancorrespond to a set of instructions for performing one or more functionsdescribed above. These instructions need not be implemented as separatesoftware programs, procedures, or modules. Memory 1450 can includeadditional instructions or fewer instructions. Furthermore, variousfunctions of the mobile device may be implemented in hardware and/or insoftware, including in one or more signal processing and/or applicationspecific integrated circuits.

Embodiments of the subject matter and the operations described in thisspecification can be implemented in digital electronic circuitry, or incomputer software, firmware, or hardware, including the structuresdisclosed in this specification and their structural equivalents, or incombinations of one or more of them. Embodiments of the subject matterdescribed in this specification can be implemented as one or morecomputer programs, i.e., one or more modules of computer programinstructions, encoded on a non-transitory computer storage medium forexecution by, or to control the operation of, data processing apparatus.Alternatively or in addition, the program instructions can be encoded onan artificially-generated propagated signal, e.g., a machine-generatedelectrical, optical, or electromagnetic signal, that is generated toencode information for transmission to suitable receiver apparatus forexecution by a data processing apparatus. A computer storage medium canbe, or be included in, a computer-readable storage device, acomputer-readable storage substrate, a random or serial access memoryarray or device, or a combination of one or more of them. Moreover,while a computer storage medium is not a propagated signal, a computerstorage medium can be a source or destination of computer programinstructions encoded in an artificially-generated propagated signal. Thecomputer storage medium can also be, or be included in, one or moreseparate physical components or media (e.g., multiple CDs, disks, orother storage devices).

The operations described in this specification can be implemented asoperations performed by a data processing apparatus on data stored onone or more computer-readable storage devices or received from othersources.

The term “data processing apparatus” encompasses all kinds of apparatus,devices, and machines for processing data, including by way of example aprogrammable processor, a computer, a system on a chip, or multipleones, or combinations, of the foregoing The apparatus can includespecial purpose logic circuitry, e.g., an FPGA (field programmable gatearray) or an ASIC (application-specific integrated circuit). Theapparatus can also include, in addition to hardware, code that createsan execution environment for the computer program in question, e.g.,code that constitutes processor firmware, a protocol stack, a databasemanagement system, an operating system, a cross-platform runtimeenvironment, a virtual machine, or a combination of one or more of them.The apparatus and execution environment can realize various differentcomputing model infrastructures, such as web services, distributedcomputing and grid computing infrastructures.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, declarative orprocedural languages, and it can be deployed in any form, including as astand-alone program or as a module, component, subroutine, object, orother unit suitable for use in a computing environment. A computerprogram may, but need not, correspond to a file in a file system. Aprogram can be stored in a portion of a file that holds other programsor data (e.g., one or more scripts stored in a markup languageresource), in a single file dedicated to the program in question, or inmultiple coordinated files (e.g., files that store one or more modules,sub-programs, or portions of code). A computer program can be deployedto be executed on one computer or on multiple computers that are locatedat one site or distributed across multiple sites and interconnected by acommunication network.

The processes and logic flows described in this specification can beperformed by one or more programmable processors executing one or morecomputer programs to perform actions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., an FPGA (field programmable gate array) or an ASIC(application-specific integrated circuit).

For a system of one or more computers to be configured to performparticular operations or actions means that the system has installed onit software, firmware, hardware, or a combination of them that inoperation cause the system to perform the operations or actions. For oneor more computer programs to be configured to perform particularoperations or actions means that the one or more programs includeinstructions that, when executed by data processing apparatus, cause theapparatus to perform the operations or actions.

Processors suitable for the execution of a computer program include, byway of example, both general and special purpose microprocessors, andany one or more processors of any kind of digital computer. Generally, aprocessor will receive instructions and data from a read-only memory ora random access memory or both. The essential elements of a computer area processor for performing actions in accordance with instructions andone or more memory devices for storing instructions and data. Generally,a computer will also include, or be operatively coupled to receive datafrom or transfer data to, or both, one or more mass storage devices forstoring data, e.g., magnetic, magneto-optical disks, or optical disks.However, a computer need not have such devices. Moreover, a computer canbe embedded in another device, e.g., a mobile telephone, a personaldigital assistant (PDA), a mobile audio or video player, a game console,a Global Positioning System (GPS) receiver, or a portable storage device(e.g., a universal serial bus (USB) flash drive), to name just a few.Devices suitable for storing computer program instructions and datainclude all forms of non-volatile memory, media and memory devices,including by way of example semiconductor memory devices, e.g., EPROM,EEPROM, and flash memory devices; magnetic disks, e.g., internal harddisks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROMdisks. The processor and the memory can be supplemented by, orincorporated in, special purpose logic circuitry.

To provide for interaction with a user, embodiments of the subjectmatter described in this specification can be implemented on a computerhaving a display device, e.g., a CRT (cathode ray tube) monitor, an LCD(liquid crystal display) monitor, or an OLED display, for displayinginformation to the user, as well as input devices for providing input tothe computer, e.g., a keyboard, a mouse, or a presence sensitive displayor other surface. Other kinds of devices can be used to provide forinteraction with a user as well; for example, feedback provided to theuser can be any form of sensory feedback, e.g., visual feedback,auditory feedback, or tactile feedback; and input from the user can bereceived in any form, including acoustic, speech, or tactile input. Inaddition, a computer can interact with a user by sending resources toand receiving resources from a device that is used by the user; forexample, by sending web pages to a web browser on a user's client devicein response to requests received from the web browser.

Embodiments of the subject matter described in this specification can beimplemented in a computing system that includes a back-end component,e.g., as a data server, or that includes a middleware component, e.g.,an application server, or that includes a front-end component, e.g., aclient computer having a graphical user interface or a Web browserthrough which a user can interact with an implementation of the subjectmatter described in this specification, or any combination of one ormore such back-end, middleware, or front-end components. The componentsof the system can be interconnected by any form or medium of digitaldata communication, e.g., a communication network. Examples ofcommunication networks include a local area network (“LAN”) and a widearea network (“WAN”), an inter-network (e.g., the Internet), andpeer-to-peer networks (e.g., ad hoc peer-to-peer networks).

The computing system can include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other. In someembodiments, a server transmits data (e.g., an HTML page) to a clientdevice (e.g., for purposes of displaying data to and receiving userinput from a user interacting with the client device). Data generated atthe client device (e.g., a result of the user interaction) can bereceived from the client device at the server.

A system of one or more computers can be configured to performparticular operations or actions by virtue of having software, firmware,hardware, or a combination of them installed on the system that inoperation causes or cause the system to perform the actions. One or morecomputer programs can be configured to perform particular operations oractions by virtue of including instructions that, when executed by dataprocessing apparatus, cause the apparatus to perform the actions.

While this specification contains many specific implementation details,these should not be construed as limitations on the scope of anyinventions or of what may be claimed, but rather as descriptions offeatures specific to particular embodiments of particular inventions.Certain features that are described in this specification in the contextof separate embodiments can also be implemented in combination in asingle embodiment. Conversely, various features that are described inthe context of a single embodiment can also be implemented in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In certain circumstances, multitasking and parallel processingmay be advantageous. Moreover, the separation of various systemcomponents in the embodiments described above should not be understoodas requiring such separation in all embodiments, and it should beunderstood that the described program components and systems cangenerally be integrated together in a single software product orpackaged into multiple software products.

Thus, particular embodiments of the subject matter have been described.Other embodiments are within the scope of the following claims. In somecases, the actions recited in the claims can be performed in a differentorder and still achieve desirable results. In addition, the processesdepicted in the accompanying figures do not necessarily require theparticular order shown, or sequential order, to achieve desirableresults. In certain implementations, multitasking and parallelprocessing may be advantageous.

1. A computer-implemented method comprising: obtaining locationinformation for a plurality of first devices; determining a subset ofthe plurality of first devices; determining a triggering boundary thatencloses a geographic region encompassing locations of the subset of theplurality of first devices; based on a size of the triggering boundary,performing one of: generating a first geofence encompassing everylocation in the subset; or generating a respective second geofencearound each location in the subset; and displaying a notification on asecond device indicative of proximity of the second device to one ormore locations associated with the subset of the plurality of firstdevices based on detection of the second device in one of the firstgeofence or any respective second geofence.
 2. The computer-implementedmethod of claim 1, wherein the subset of the plurality of first devicesincludes N−1 of the plurality of first devices closest to a geographicallocation of the second device, wherein N is an integer representing atotal number of the plurality of first devices.
 3. Thecomputer-implemented method of claim 1, further comprising: comparing asize of the triggering boundary to a threshold.
 4. Thecomputer-implemented method of claim 3, wherein the threshold is a ratioof a radius of the triggering boundary to a ratio of each local geofenceassociated with each device in the subset.
 5. The computer-implementedmethod of claim 3, wherein the first geofence is generated when the sizeof the triggering boundary is less than the threshold.
 6. Thecomputer-implemented method of claim 3, wherein the respective secondgeofence is generated around each location in the subset when the sizeof the triggering boundary is equal to or greater than the threshold. 7.The computer-implemented method of claim 6, wherein generating therespective second geofence around each location in the subset includesmodifying a previously generated respective geofence around eachlocation in the subset.
 8. The computer-implemented method of claim 7,wherein the modifying includes enlarging each previously generatedrespective geofence to have a radius that is proportional to a radius ofthe triggering boundary.
 9. The computer-implemented method of claim 3,wherein comparing the size of the triggering boundary to the thresholdincludes determining a number of first devices in the subset; the firstgeofence is generated when the number of first devices in the subset ismore than the threshold; and each respective second geofence isgenerated when then number of first devices in the subset is less thanthe threshold.
 10. The computer-implemented method of claim 1, whereinthe first devices are merchant devices and the second device is a userdevice.
 11. A device comprising: memory having computer-readableinstructions stored therein; and one or more processors configured toexecute the computer-readable instructions to, obtain locationinformation for a plurality of merchant devices; determine a subset ofthe plurality of merchant devices; determine a triggering boundary thatencloses a geographic region encompassing locations of the subset of theplurality of merchant devices; generate one or more geofences that isone of, a first geofence encompassing every location in the subset; or arespective second geofence around each location in the subset; anddisplay a notification on the device indicative of proximity of thedevice to one or more locations associated with the subset of theplurality of merchant devices based on detection of the device in one ofthe first geofence or any respective second geofence.
 12. The device ofclaim 11, wherein the one or more processors are configured to generatethe first geofence or respective second geofences based on comparing asize of the triggering boundary to a threshold.
 13. The device of claim12, wherein the threshold is a ratio of a radius of the triggeringboundary to a ratio of each local geofence encompassing one merchantdevice in the subset.
 14. The device of claim 12, wherein the firstgeofence is generated when the size of the triggering boundary is lessthan the threshold.
 15. The device of claim 12, wherein the respectivesecond geofence is generated around each location in the subset when thesize of the triggering boundary is greater than the threshold.
 16. Thedevice of claim 15, wherein generating the respective second geofencearound each location in the subset includes modifying a previouslygenerated respective geofence around each location in the subset. 17.The device of claim 16, wherein the modifying includes enlarging eachpreviously generated respective geofence to have a radius that isproportional to a radius of the triggering boundary.
 18. The device ofclaim 12, wherein comparing the size of the triggering boundary to thethreshold includes determining a number of merchant devices in thesubset; the first geofence is generated when the number of merchantdevices in the subset is more than the threshold; and each respectivesecond geofence is generated when then number of merchant devices in thesubset is less than the threshold.
 19. A non-transitorycomputer-readable medium having computer-readable instructions, whichwhen executed by one or more processors, cause the one or moreprocessors to, obtain location information for a plurality of firstdevices; determine a subset of the plurality of first devices; determinea triggering boundary that encloses a geographic region encompassinglocations of the subset of the plurality of first devices; determine ifthe triggering boundary satisfies a condition; generate a first geofenceencompassing every location in the subset, if the triggering boundarydoes not satisfy the threshold; generate a respective second geofencearound each location in the subset if the triggering boundary satisfiesthe threshold; and display a notification on a second device indicativeof proximity of the second device to one or more locations associatedwith the subset of the plurality of first devices based on detection ofthe second device in one of the first geofence or any respective secondgeofence.
 20. The non-transitory computer-readable medium of claim 19,wherein the threshold is at least one of: a number of merchant devicesin the subset being less than an predetermined number; and a ratio of aradius of the triggering boundary being equal to or greater than aradius of an existing local geofence around each device in the subset.